/// <reference path="../typings/index.d.ts" />
/// <reference path="../src/orderService.ts" />
/// <reference path="../src/tms.ts" />
describe('getOrderData', () => {
    var injector:ng.auto.IInjectorService;
    var service:IorderService;
    beforeEach(() => {
        injector = angular.injector(['ng', 'tms']);
        service = injector.get<IorderService>('orderService');
    });
    /**
     * 承运商test
     */
    //承运商无条件获取列表
    it("get carryOrder list normal",(done) => {
        service.carryOrderList("",true,"","","","","","","","","","","","","","","","","","","","","",0,10).then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.list.length).toBe(10);
            expect(res.data.extData).toBe('|true||||||||||||||||||||||0|10');
            done();
        },(err) => {
            done.fail(err);
        })
    });
    //承运商订单编号包含"1"的列表
    it("get carryOrder list by orderId \'1\' ",(done) => {
        service.carryOrderList("",true,"1","","","","","","","","","","","","","","","","","","","","",0,-1).then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.extData).toBe('|true|1|||||||||||||||||||||0|-1');
            done();
        },(err) => {
            done.fail(err);
        })
    });
    //承运商订单状态编号为“3”(已派车)状态的列表
    it("get carryOrder list by status \'3\' ",(done) => {
        service.carryOrderList("",true,"","","3","","","","","","","","","","","","","","","","","","",0,-1).then((res) => {
            expect(res.data.extData).toBe('|true|||3|||||||||||||||||||0|-1');
            done();
        },(err) => {
            done.fail(err);
        })
    });
    //承运商客户单位为"江苏斯诺"的列表
    it("get carryOrder list by clientName \'江苏斯诺\' ",(done) => {
        service.carryOrderList("",true,"","江苏斯诺","","","","","","","","","","","","","","","","","","","",0,-1).then((res) => {
            expect(res.data.extData).toBe('|true||江苏斯诺||||||||||||||||||||0|-1');
            done();
        },(err) => {
            done.fail(err);
        })
    });
    //承运商发货地址为"江苏镇江"的列表
    it("get carryOrder list by shipAddress \'江苏镇江\'",(done) => {
        service.carryOrderList("",true,"","","","","","","","","江苏镇江","","","","","","","","","","","","",0,-1).then((res) => {
            expect(res.data.extData).toBe('|true|||||||||江苏镇江|||||||||||||0|-1');
            done();
        },(err) => {
            done.fail(err);
        })
    });

    //承运商发货起始时间为"2016.07.16 07:16"之后的列表
    it("get carryOrder list by shipStartTime \'2016.07.16 07:16\'",(done) => {
        service.carryOrderList("",true,"","","","2016.07.16 07:16","","","","","","","","","","","","","","","","","",0,-1).then((res) => {
            expect(res.data.extData).toBe('|true||||2016.07.16 07:16||||||||||||||||||0|-1');
            done();
        },(err) => {
            done.fail(err);
        })
    });

    //承运商传入所有参数的列表
    it("get carryOrder list allArgument",(done) => {
        service.carryOrderList("1",true,"2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22",0,10).then((res) => {
            expect(res.data.extData).toBe('1|true|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|0|10');
            done();
        },(err) => {
            done.fail(err);
        })
    });


    //获取订单编号为"11"的订单子单的列表数据
    it("get orderChildList list allArgument",(done) => {
        service.orderChildList("11").then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.extData).toBe('11');
            done();
        },(err) => {
            done.fail(err);
        })
    });



    //获取承运单编号为"11"的费用列表数据
    it("get feeList list allArgument",(done) => {
        service.feeList("11").then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.extData).toBe('11');
            done();
        },(err) => {
            done.fail(err);
        })
    });


    //获取订单编号为'11'的应收列表数据
    it("get receivable list allArgument",(done) => {
        service.receivableList("11").then((res) => {
            expect(res.data.total).toBeGreaterThan(0);
            expect(res.data.extData).toBe('11');
            done();
        },(err) => {
            done.fail(err);
        })
    });


    //获取订单详情
    it("get orderDetail",(done) => {
        service.detail("11").then((res) =>{
            expect(res.data.planOfficer).toBe("1");
            expect(res.data.businessOfficer).toBe("2");
            expect(res.data.customerServiceOfficer).toBe("3");
            expect(res.data.dispatchOfficer).toBe("4");
            expect(res.data.plannerId).toBe(5);
            expect(res.data.placeOrderTime).toBe("6");
            expect(res.data.urgencyDegree).toBe("7");
            expect(res.data.clientName).toBe("8");
            expect(res.data.consignorName).toBe("9");
            expect(res.data.consignorPhone).toBe("10");
            expect(res.data.viaAddressList).toBe("11");
            expect(res.data.orderStatus).toBe(12);
            expect(res.data.quantityOfGoods).toBe("12");
            expect(res.data.orderId).toBe("13");
            expect(res.data.urgency).toBe(14);
            expect(res.data.urgencyUnit).toBe("15");
            expect(res.data.businessOfficerId).toBe("16");
            expect(res.data.customerServiceOfficerId).toBe("17");
            expect(res.data.dispatchOfficerId).toBe("18");
            expect(res.data.clientId).toBe("19");
            expect(res.data.clientCornet).toBe("20");   
            expect(res.data.consignorId).toBe("21");
            expect(res.data.shipPriceContent).toBe("22");
            expect(res.data.carType).toBe("23");
            expect(res.data.carLength).toBe("24");
            expect(res.data.carriageWay).toBe("25");
            expect(res.data.loadingResult).toBe("26");
            expect(res.data.attachment.length).toBe(3);
            expect(res.data.remarks).toBe("28");
            expect(res.data.viaList.length).toBe(2);
            expect(res.data.shipProvince).toBe("30");
            expect(res.data.shipCity).toBe("31");
            expect(res.data.shipArea).toBe("32");
            expect(res.data.shipDetail).toBe("33");
            expect(res.data.shipAddress).toBe("34");
            expect(res.data.deliverProvince).toBe("35");
            expect(res.data.deliverCity).toBe("36");
            expect(res.data.deliverArea).toBe("37");
            expect(res.data.deliverDetail).toBe("38");
            expect(res.data.deliverAddress).toBe("39");
            expect(res.data.shipTime).toBe("40");
            expect(res.data.arriveTime).toBe("41");
            expect(res.data.mileage).toBe(42);
            expect(res.data.goodsTypeId).toBe("43");
            expect(res.data.goodsType).toBe("44");
            expect(res.data.goodsId).toBe("45");
            expect(res.data.goodsName).toBe("46");
            expect(res.data.goodsNum).toBe(47);
            expect(res.data.goodsNumUnit).toBe("48");
            expect(res.data.goodsNumTwo).toBe("49");
            expect(res.data.goodsNumUnitTwo).toBe("50");
            expect(res.data.tonRange).toBe("51");
            expect(res.data.dispatcherName).toBe("52");
            expect(res.data.dispatcherPhone).toBe("53");
            expect(res.data.businessAffairsName).toBe("54");
            expect(res.data.customerServiceName).toBe("55");
            expect(res.data.plannerName).toBe("56");
            expect(res.data.extData).toBe("11");
            done();
        },(err) => {
             done.fail(err);
        })
    })

    //获取子单详情
    it("get orderChildDetail",(done) => {
        service.orderChild("11").then((res) => {
             expect(res.data.id).toBe("1");
             expect(res.data.orderId).toBe("2");
             expect(res.data.shipProvince).toBe("3");
             expect(res.data.shipCity).toBe("4");
             expect(res.data.shipArea).toBe("5");
             expect(res.data.shipAddress).toBe("6");
             expect(res.data.viaAddressList.length).toBe(2);
             expect(res.data.deliverProvince).toBe("8");
             expect(res.data.deliverCity).toBe("9");
             expect(res.data.deliverArea).toBe("10");
             expect(res.data.deliverAddress).toBe("11");
             expect(res.data.shipTime).toBe("12");
             expect(res.data.arriveTime).toBe("13");
             expect(res.data.mileage).toBe(14);
             expect(res.data.goodsTypeId).toBe("15");
             expect(res.data.goodsType).toBe("16");
             expect(res.data.goodsId).toBe("17");
             expect(res.data.goodsName).toBe("18");
             expect(res.data.goodsNum).toBe(19);
             expect(res.data.goodsNumUnit).toBe("20");
             expect(res.data.goodsNumTwo).toBe("21");
             expect(res.data.goodsNumUnitTwo).toBe("22");
             expect(res.data.tonRange).toBe("23");
             expect(res.data.receivablePrice).toBe(24);
             expect(res.data.receivablePriceUnit).toBe("25");
             expect(res.data.receivableTotal).toBe(26);
             expect(res.data.settleType).toBe("27");
             expect(res.data.includeTax).toBe("28");
             expect(res.data.receivableRemarks).toBe("29");
             expect(res.data.settleId).toBe("30");
             expect(res.data.reckoner).toBe("31");
             expect(res.data.projectId).toBe("32");
             expect(res.data.projectCode).toBe("33");
             expect(res.data.projectName).toBe("34");
             expect(res.data.shipOrderId).toBe("35");
             expect(res.data.takeGoodsCompanyId).toBe("36");
             expect(res.data.takeGoodsCompany).toBe("37");
             expect(res.data.consignee).toBe("38");
             expect(res.data.classonsigneePhone).toBe("39");
             expect(res.data.projectTotal).toBe("40");
             expect(res.data.projectTotalUnit).toBe("41");
             expect(res.data.extData).toBe("11");
             done();
        },(err) => {
            done.fail(err);
        })
    })

    //获取承运单详情
    it("get carryOrderDetail",(done) => {
        service.carryOrder("11").then((res) => {
            expect(res.data.contract.carrierOrderId).toBe('1');
            expect(res.data.contract.contractId).toBe('2');
            expect(res.data.contract.contractNumber).toBe('3');
            expect(res.data.contract.contractGoodsNum).toBe(4);
            expect(res.data.contract.contractGoodsNumUnit).toBe('5');
            expect(res.data.contract.contractTime).toBe('6');
            expect(res.data.contract.consignee).toBe('7');
            expect(res.data.contract.consigneePhone).toBe('8');
            expect(res.data.contract.oilCardStatus).toBe('9');
            expect(res.data.contract.oilCarNum).toBe('10');
            expect(res.data.contract.auxiliaryTool).toBe('11');
            expect(res.data.contract.engineNumber).toBe('12');
            expect(res.data.contract.frameNumber).toBe('13');
            expect(res.data.contract.trailerNumber).toBe('14');
            expect(res.data.contract.trailerFrameNumber).toBe('15');
            expect(res.data.contract.driverLicenseNumber).toBe('16');
            expect(res.data.contract.altermatePhone).toBe('17');
            expect(res.data.contract.attachmentList.length).toBe(2);
            expect(res.data.contract.remarks).toBe('19');

            expect(res.data.contractStatus).toBe('2');
            expect(res.data.tempCustomerService).toBe('3');
            expect(res.data.tempCustomerServiceId).toBe(4);
            expect(res.data.orderCodeList.length).toBe(3);
            expect(res.data.orderRemarks).toBe('6');
            expect(res.data.orderList.length).toBe(3);
            expect(res.data.carrierId).toBe('8');
            expect(res.data.carrierName).toBe('9');
            expect(res.data.carrierPhone).toBe('10');
            expect(res.data.carrierType).toBe('11');
            expect(res.data.carId).toBe('12');
            expect(res.data.carCode).toBe('13');
            expect(res.data.driverPhone).toBe('14');
            expect(res.data.driverName).toBe('15');
            expect(res.data.carLength).toBe('16');
            expect(res.data.carType).toBe('17');
            expect(res.data.carrierReceivablePirce).toBe(18);
            expect(res.data.carrierReceivablePirceUnit).toBe('19');
            expect(res.data.carrierReceivableRemarks).toBe('20');
            
            expect(res.data.advancePaymentList.length).toBe(1);
            expect(res.data.advancePaymentList[0].advancePrice).toBe(21);
            expect(res.data.advancePaymentList[0].advancePriceType).toBe("21");

            expect(res.data.receiptPrice).toBe(22);
            expect(res.data.receiptPriceType).toBe('23');
            expect(res.data.holder).toBe('24');
            expect(res.data.bankId).toBe('25');
            expect(res.data.bankCode).toBe('26');
            expect(res.data.openBank).toBe('27');
            expect(res.data.receiptPriceHolder).toBe('28');
            expect(res.data.receiptPriceBankId).toBe('29');
            expect(res.data.receiptPriceBankCode).toBe('30');
            expect(res.data.receiptPriceOpenBank).toBe('31');
            expect(res.data.carryOrderRemarks).toBe('32');
            expect(res.data.attachment.length).toBe(3);
            expect(res.data.attachmentDetails).toBe('34');
            expect(res.data.extData).toBe('11');
            done();
        },(err) => {
            done.fail(err);
        })
    })


    //添加评价
    it("Post addEvaluate",(done) => {
        service.addEvaluate("1","2","3","4","5","6",7,8,9,10,"11",true,"13","14").then((res) => {
            expect(res.data.extData).toBe("1|2|3|4|5|6|7|8|9|10|11|true|13|14");
            done();
        },(err) => {
            done.fail(err);
        })
    });


    //添加承运单
    it("Post addCarryOrder",(done) => {
        service.addCarryOrder(["1","1"],"2","3","4","5","6","7","8","9","10","11",12,"13","14",[{advancePrice:15,advancePriceType:"15"}],"16","17","18","19","20","21","22","23","24","25","26",["27","27"],"28").then((res) => {
            expect(res.data.extData).toBe("1,1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|15|16|17|18|19|20|21|22|23|24|25|26|27,27|28");
            done();
        },(err) => {
            done.fail(err);
        })
    });

    
    //添加合同
    it("Post addContract",(done) => {
        service.addContract("1","2","3",4,"5","6","7","8","9","10","11","12","13","14","15","16","17",["18","18"],"19").then((res) => {
            expect(res.data.extData).toBe("1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18,18|19");
            done();
        },(err) => {
            done.fail(err);
        })
    });

    //添加应收登记
    it("Post addReceivable",(done) => {
        service.addReceivable("1","2","3","4","5","6",7,"8",9,"10","11","12","13","14","15","16","17",18).then((res) =>{
            expect(res.data.extData).toBe("1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18");
            done();
        },(err) => {
            done.fail(err);
        })
    });

    //添加费用申领
    it("Post addFee",(done) =>{
        service.addFee("1","2",3,4,"5","6","7","8","9","10").then((res) => {
            expect(res.data.extData).toBe("1|2|3|4|5|6|7|8|9|10");
            done();
        },(err) => {
            done.fail(err);
        })
    });

    //订单编辑重下
    it("Put EditOrder",(done)=>{
        service.edit("11","1",2,"3","4","5","6","7","8","9","10","11","12","13","14",["15","15"],"16",
        [{
            orderId:"17.1",
            shipProvince:"17.2",
            shipCity:"17.3",
            shipArea:"17.4",
            shipAddress:"17.5",
            viaAddressList:"17.6",
            deliverProvince:"17.7",
            deliverCity:"17.8",
            deliverArea:"17.9",
            deliverAddress:"17.10",
            shipTime:"17.11",
            arriveTime:"17.12",
            mileage:17.13,
            goodsTypeId:"17.14",
            goodsType:"17.15",
            goodsId:"17.16",
            goodsName:"17.17",
            goodsNum:17.18,
            goodsNumUnit:"17.19",
            goodsNumTwo:"17.20",
            goodsNumUnitTwo:"17.21",
            tonRange:"17.22",
            receivablePrice:17.23,
            receivablePriceUnit:"17.24",
            receivableTotal:17.25,
            settleType:"17.26",
            includeTax:"17.27",
            receivableRemarks:"17.28",
            settleId:"17.29",
            reckoner:"17.30",
            projectId:"17.31",
            projectCode:"17.32",
            projectName:"17.33",
            shipOrderId:"17.34",
            takeGoodsCompanyId:"17.35",
            takeGoodsCompany:"17.36",
            consignee:"17.37",
            consigneePhone:"17.38",
            projectTotal:"17.39",
            projectTotalUnit:"17.40"
        }],[{province:"18.1",city:"18.2",county:"18.3",details:"18.4"}],"19","20","21","22","23","24","25","26","27","28","29","30",31,"32","33","34","35",36,"37","38","39","40","41","42","43","44","45","46").then((res) => {
            expect(res.data.extData).toBe("11|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15,15|16|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|17.1|17.2|17.3|17.4|17.5|17.6|17.7|17.8|17.9|17.10|17.11|17.12|17.13|17.14|17.15|17.16|17.17|17.18|17.19|17.20|17.21|17.22|17.23|17.24|17.25|17.26|17.27|17.28|17.29|17.30|17.31|17.32|17.33|17.34|17.35|17.36|17.37|17.38|17.39|17.40|18.1|18.2|18.3|18.4");
            done();
        },(err) => {
            done.fail(err);
        })
    })

    // 编辑承运单
    it("Put editCarrierOrder",(done) => {
        service.editCarrierOrder("11",["1","1"],"2","3","4","5","6","7","8","9","10","11",12,"13","14",[{advancePrice:15.1,advancePriceType:"15.2"}],16,"17","18","19","20","21","22","23","24","25","26",["27","27"],"28").then((res) => {
            expect(res.data.extData).toBe("11|1,1|2|3|4|5|6|7|8|9|10|11|12|13|14|15.1|15.2|16|17|18|19|20|21|22|23|24|25|26|27,27|28");
            done();
        },(err) =>{
            done.fail(err);
        })
    })

    // 编辑订单状态
    it("Put editOrderStatus",(done) => {
        service.editOrderStatus("11","1","2","3","4").then((res)=>{
            expect(res.data.extData).toBe("11|1|2|3|4");
            done();
        },(err) => {
            done.fail(err);
        })
    })

    //编辑承运单状态
    it("Put editOrderStatusByCarrierOrderId",(done) => {
        service.editOrderStatusByCarrierOrderId("11","1","2","3","4").then((res) => {
            expect(res.data.extData).toBe("11|1|2|3|4");
            done();
        },(err) => {
            done.fail(err);
        })
    });

    //编辑费用
    it("Put editFee",(done) => {
        service.editFee("11","1","2",3,"4","5","6","7","8","9","10").then((res) => {
            expect(res.data.extData).toBe("11|1|2|3|4|5|6|7|8|9|10");
            done();
        },(err) => {
            done.fail(err);
        });
    });

    //编辑合同
    it("Put editContract",(done) => {
        service.editContract("11","1","2","3",4,"5","6","7","8","9","10","11","12","13","14","15","16","17",["18","18"],"19").then((res) => {
            expect(res.data.extData).toBe("11|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18,18|19");
            done();
        },(err) => {
            done.fail(err);
        })
    });

    //编辑应收登记
    it("Put editReceivable",(done)=>{
        service.editReceivable("11","1","2","3","4","5","6",7,"8",9,"10","11","12","13","14","15","16","17",18).then((res) => {
            expect(res.data.extData).toBe("11|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18");
            done();
        },(err) => {
            done.fail(err);
        })
    });

    //变换客服/调度专员
    it("Put editOfficer",(done) => {
        service.editOfficer("11","1","2","3","4","5").then((res) => {
            expect(res.data.extData).toBe("11|1|2|3|4|5")
            done();
        },(err) => {
            done.fail(err);
        })
    });

    //删除订单
    it("Delete deleteOrder",(done) => {
        service.delete("11").then((res) => {
            expect(res.data.extData).toBe("11")
            done();
        },(err) => {
            done.fail(err);
        })
    });

    //删除费用申领
    it("Delete deleteFee",(done) => {
        service.deleteFee("11","22").then((res) => {
            expect(res.data.extData).toBe("11|22")
            done();
        },(err) => {
            done.fail(err);
        })
    });

    //删除承运单
    it("Delete deleteCarrierOrder",(done) => {
        service.deleteCarrierOrder("11").then((res) => {
            expect(res.data.extData).toBe("11")
            done();
        },(err) => {
            done.fail();
        })
    });


    //通过订单删除应收登记
    it("Delete delReceivableByOrderId",(done) => {
        service.delReceivableByOrderId("11","22").then((res) => {
            expect(res.data.extData).toBe("11|22");
            done();
        },(err) => {
            done.fail();
        })
    });
    
    //通过子单删除应收登记
    it("Delete delReceivableByChildId",(done) => {
        service.delReceivableByChildId("11","22","33").then((res) => {
            expect(res.data.extData).toBe("11|22|33")
            done();
        },(err) => {
            done.fail();
        })
    });

    //修改是否确认应收
    it("Put changeIsCheckReceivable",(done) => {
        service.changeIsCheckReceivable("11",false).then((res) => {
             expect(res.data.extData).toBe("11|false");
            done();
        },(err) => {
            done.fail(err);
        })
    });

    // 无条件获取列表
    it("Get reportCarrierOrderList list normal",(done) => {
        service.reportCarrierOrderList("",true,"","","","","","","","",0,10).then((res) => {
            expect(res.data.extData).toBe("|true|||||||||0|10");
            done();
        },(err) => {
            done.fail(err);
        })
    });

    
   //获取合同号参数包含"1"的承运单报表列表
   it("Get reportCarrierOrderList list by contractNum \'1\'",(done) => {
        service.reportCarrierOrderList("",true,"1","","","","","","","",0,10).then((res) => {
            expect(res.data.extData).toBe("|true|1||||||||0|10");
            done();
        },(err) => {
            done.fail(err);
        })
    }); 

    //获取客户单位参数包含"江苏"的承运单报表列表
   it("Get reportCarrierOrderList list by clientName \'江苏\'",(done) => {
        service.reportCarrierOrderList("",true,"","江苏","","","","","","",0,-1).then((res) => {
            expect(res.data.extData).toBe("|true||江苏|||||||0|-1");
            done();
        },(err) => {
            done.fail(err);
        })
    }); 

   //获取发货地址参数包含"江苏"的承运单报表列表
   it("Get reportCarrierOrderList list by shipAddress \'江苏\'",(done) => {
        service.reportCarrierOrderList("",true,"","","江苏","","","","","",0,-1).then((res) => {
            expect(res.data.extData).toBe("|true|||江苏||||||0|-1");
            done();
        },(err) => {
            done.fail(err);
        })
    }); 

    //获取发货开始时间参数"2016.07.16 09:29"之后的承运单报表列表
   it("Get reportCarrierOrderList list by shipStartTime \'2016.07.16 09:29\'",(done) => {
        service.reportCarrierOrderList("",true,"","","","2016.07.16 09:29","","","","",0,-1).then((res) => {
            expect(res.data.extData).toBe("|true||||2016.07.16 09:29|||||0|-1");
            done();
        },(err) => {
            done.fail(err);
        })
    }); 

    //获取承运商名称参数包含"江苏"的承运单报表列表
   it("Get reportCarrierOrderList list by carrierName \'江苏\'",(done) => {
        service.reportCarrierOrderList("",true,"","","","","","","江苏","",0,-1).then((res) => {
            expect(res.data.extData).toBe("|true|||||||江苏||0|-1");
            done();
        },(err) => {
            done.fail(err);
        })
    }); 

   //获取驾驶员参数包含"1"的承运单报表列表
   it("Get reportCarrierOrderList list by driver \'1\'",(done) => {
        service.reportCarrierOrderList("",true,"","","","","","","","1",0,-1).then((res) => {
            expect(res.data.extData).toBe("|true||||||||1|0|-1");
            done();
        },(err) => {
            done.fail(err);
        });
    }); 

    // 获取所有参数条件的承运单报表列表
    it("Get reportCarrierOrderList list by allArgument",(done) => {
        service.reportCarrierOrderList("1",true,"3","4","5","6","7","8","9","10",0,10).then((res) => {
            expect(res.data.extData).toBe("1|true|3|4|5|6|7|8|9|10|0|10");
            done();
        },(err) => {
            done.fail(err);
        })
    });




    //客户经理退回派车
    it("Put managerReturnDispatch",(done) =>{
        service.managerReturnDispatch("11").then((res) => {
            expect(res.data.extData).toBe("11");
            done();
        },(err) => {
            done.fail(err);
        })   
    });


    //常规无条件获取订单列表
    it("Get orderList list normal",(done) =>{
        service.list("",true,"","","","","","","","","","","","",0,10).then((res) => {
            expect(res.data.extData).toBe("|true|||||||||||||0|10");
            expect(res.data.total).toBe(10);
            done();
        },(err) => {
            done.fail(err);
        })   
    });
    
    //获取订单编号包含"1"的订单列表
    it("Get orderList list by orderId \'1\' ",(done) =>{
        service.list("",true,"1","","","","","","","","","","","",0,10).then((res) => {
            expect(res.data.extData).toBe("|true|1||||||||||||0|10");
            done();
        },(err) => {
            done.fail(err);
        })   
    });

    //获取客户单位名称包含"江苏"的订单列表
    it("Get orderList list by clientName \'江苏\' ",(done) =>{
        service.list("",true,"","江苏","","","","","","","","","","",0,10).then((res) => {
            expect(res.data.extData).toBe("|true||江苏|||||||||||0|10");
            done();
        },(err) => {
            done.fail(err);
        })   
    });

    //获取线路地址包含"江苏"的订单列表
    it("Get orderList list by route \'江苏\' ",(done) =>{
        service.list("",true,"","","江苏","","","","","","","","","",0,10).then((res) => {
            expect(res.data.extData).toBe("|true|||江苏||||||||||0|10");
            done();
        },(err) => {
            done.fail(err);
        })   
    });

    //获取所有订单状态的订单列表
    it("Get orderList list by Status \'1,2,3,4,5,6,7,8\' ",(done) =>{
        service.list("",true,"","","","","","1,2,3,4,5,6,7,8","","","","","","",0,10).then((res) => {
            expect(res.data.extData).toBe("|true||||||1,2,3,4,5,6,7,8|||||||0|10");
            done();
        },(err) => {
            done.fail(err);
        })   
    });

    //获取调度专员编号为"1"订单列表
    it("Get orderList list by dispatchOfficerId \'1\' ",(done) =>{
        service.list("",true,"","","","","","","","","1","","","",0,10).then((res) => {
            expect(res.data.extData).toBe("|true|||||||||1||||0|10");
            done();
        },(err) => {
            done.fail(err);
        })   
    });

    //获取客服专员编号为"1"订单列表
    it("Get orderList list by customerServiceId \'1\' ",(done) =>{
        service.list("",true,"","","","","","","","","","","","1",0,10).then((res) => {
            expect(res.data.extData).toBe("|true||||||||||||1|0|10");
            done();
        },(err) => {
            done.fail(err);
        })   
    });


    //获取订单传入所有参数的返回列表
    it("Get orderList list allArgument",(done) =>{
        service.list("1",true,"3","4","5","6","7","8,8,8","9","10","11","12","13","14",0,10).then((res) => {
            expect(res.data.extData).toBe("1|true|3|4|5|6|7|8,8,8|9|10|11|12|13|14|0|10");
            done();
        },(err) => {
            done.fail(err);
        })   
    });

    //添加订单
    it("Post addOrder",(done)=>{
        service.add("1",2,"3","4","5","6","7","8","9","10","11","12","13","14",["15","15"],"16",
            [{
                orderId:"17.1",
                shipProvince:"17.2",
                shipCity:"17.3",
                shipArea:"17.4",
                shipAddress:"17.5",
                viaAddressList:"17.6",
                deliverProvince:"17.7",
                deliverCity:"17.8",
                deliverArea:"17.9",
                deliverAddress:"17.10",
                shipTime:"17.11",
                arriveTime:"17.12",
                mileage:17.13,
                goodsTypeId:"17.14",
                goodsType:"17.15",
                goodsId:"17.16",
                goodsName:"17.17",
                goodsNum:17.18,
                goodsNumUnit:"17.19",
                goodsNumTwo:"17.20",
                goodsNumUnitTwo:"17.21",
                tonRange:"17.22",
                receivablePrice:17.23,
                receivablePriceUnit:"17.24",
                receivableTotal:17.25,
                settleType:"17.26",
                includeTax:"17.27",
                receivableRemarks:"17.28",
                settleId:"17.29",
                reckoner:"17.30",
                projectId:"17.31",
                projectCode:"17.32",
                projectName:"17.33",
                shipOrderId:"17.34",
                takeGoodsCompanyId:"17.35",
                takeGoodsCompany:"17.36",
                consignee:"17.37",
                consigneePhone:"17.38",
                projectTotal:"17.39",
                projectTotalUnit:"17.40"
            }],[{province:"18.1",city:"18.2",county:"18.3",details:"18.4"}],"19","20","21","22","23","24","25","26","27","28","29","30",31,"32","33","34","35",36,"37","38","39","40","41","42","43","44","45","46").then((res) => {
                expect(res.data.extData).toBe("1|2|3|4|5|6|7|8|9|10|11|12|13|14|15,15|16|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|17.1|17.2|17.3|17.4|17.5|17.6|17.7|17.8|17.9|17.10|17.11|17.12|17.13|17.14|17.15|17.16|17.17|17.18|17.19|17.20|17.21|17.22|17.23|17.24|17.25|17.26|17.27|17.28|17.29|17.30|17.31|17.32|17.33|17.34|17.35|17.36|17.37|17.38|17.39|17.40|18.1|18.2|18.3|18.4");
                done();
            },(err) => {
                done.fail(err);
            });
    })


    // 获取订单编号为"1"下的APP竞价列表
    it("Get quotation",(done) => {
        service.quotation("11").then((res) => {
            expect(res.data.extData).toBe("11");
            done();
        },(err) =>{
            done.fail(err);
        })
    });

    /**
     * 导出承运单Excel
     */

    //获取导出承运商订单编号包含"1"的列表
    it("get excelCarryOrderList list by orderId \'1\' ",(done) => {
        service.excelCarryOrderList("",true,"1","","","","","","","","","","","","","","","","","","",false).then((res) => {
            expect(res.data.extData).toBe("|true|1|||||||||||||||||||false");
            done();
        },(err) => {
            done.fail(err);
        })
    });

    //获取导出承运商订单状态编号为“3”(已派车)状态的列表
    it("get excelCarryOrderList list by status \'3\' ",(done) => {
        service.excelCarryOrderList("",true,"","","","","","3","","","","","","","","","","","","","",false).then((res) => {
            expect(res.data.extData).toBe("|true||||||3||||||||||||||false");
            done();
        },(err) => {
            done.fail(err);
        })
    });
    //获取导出承运商客户单位为"江苏斯诺"的列表
    it("get excelCarryOrderList list by clientName \'江苏斯诺\' ",(done) => {
        service.excelCarryOrderList("",true,"","江苏斯诺","","","","","","","","","","","","","","","","","",false).then((res) => {
            expect(res.data.extData).toBe("|true||江苏斯诺||||||||||||||||||false");
            done();
        },(err) => {
            done.fail(err);
        })
    });
    //获取导出承运商发货地址为"江苏镇江"的列表
    it("get excelCarryOrderList list by shipAddress \'江苏镇江\'",(done) => {
        service.excelCarryOrderList("",true,"","","","","","","","","江苏镇江","","","","","","","","","","",false).then((res) => {
            expect(res.data.extData).toBe("|true|||||||||江苏镇江|||||||||||false");
            done();
        },(err) => {
            done.fail(err);
        })
    });

    //获取导出承运商发货起始时间为"2016.07.16 07:16"之后的列表
    it("get excelCarryOrderList list by shipStartTime \'2016.07.16 07:16\'",(done) => {
        service.excelCarryOrderList("",true,"","","","2016.07.16 07:16","","","","","","","","","","","","","","","",false).then((res) => {
            expect(res.data.extData).toBe("|true||||2016.07.16 07:16||||||||||||||||false");
            done();
        },(err) => {
            done.fail(err);
        })
    });

    //获取导出承运商合同号包含"1"的承运单列表
    it("get excelCarryOrderList list by contractNum \'1\'",(done) => {
        service.excelCarryOrderList("",true,"","","","","","","","","","","","1","","","","","","","",false).then((res) => {
            expect(res.data.extData).toBe("|true||||||||||||1||||||||false");
            done();
        },(err) => {
            done.fail(err);
        })
    });
    
    //全条件获取承运单列表
    it("Get excelCarryOrderList list allArgument",(done) => {
        service.excelCarryOrderList("1",true,"3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21",false).then((res) => {
            expect(res.data.extData).toBe("1|true|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|false");
            done();
    },(err) => {
            done.fail(err);
        })
    });

    //导出回单管理列表exce

    //导出回单管理列表无条件获取列表
    it("Get excelReceiptexport list normal",(done) => {
        service.excelReceiptexport("",true,"","","","","","","","","","","","","","","","","","","").then((res)=>{
            expect(res.data.extData).toBe("|true|||||||||||||||||||");
            done();
        },(err) => {
            done.fail(err);
        })
    });

    //获取订单号包含"1"的导出回单管理列表
    it("Get excelReceiptexport list by orderId \'1\'",(done) => {
        service.excelReceiptexport("",true,"1","","","","","","","","","","","","","","","","","","").then((res)=>{
            expect(res.data.extData).toBe("|true|1||||||||||||||||||");
            done();
        },(err) => {
            done.fail(err);
        })
    });

    //获取客户单位名称包含"江苏"的导出回单管理列表
    it("Get excelReceiptexport list by clientName \'江苏\'",(done) => {
        service.excelReceiptexport("",true,"","江苏","","","","","","","","","","","","","","","","","").then((res)=>{
            expect(res.data.extData).toBe("|true||江苏|||||||||||||||||");
            done();
        },(err) => {
            done.fail(err);
        })
    });

    //获取所有订单状态的导出回单管理列表
    it("Get excelReceiptexport list by allStatus \'1,2,3,4,5,6,7,8\'",(done) => {
        service.excelReceiptexport("",true,"","","","","","1,2,3,4,5,6,7,8","","","","","","","","","","","","","").then((res)=>{
            expect(res.data.extData).toBe("|true||||||1,2,3,4,5,6,7,8|||||||||||||");
            done();
        },(err) => {
            done.fail(err);
        })
    });

    //获取车长包含"13"回单管理列表
    it("Get excelReceiptexport list by carLength \'13\'",(done) => {
        service.excelReceiptexport("",true,"","","","","","","","","","","","","","","","","","","13").then((res)=>{
            expect(res.data.extData).toBe("|true|||||||||||||||||||13");
            done();
        },(err) => {
            done.fail(err);
        })
    });

    //回单管理列表全条件获取列表
    it("Get excelReceiptexport list allArgument",(done) => {
        service.excelReceiptexport("1",true,"3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21").then((res)=>{
            expect(res.data.extData).toBe("1|true|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21");
            done();
        },(err) => {
            done.fail(err);
        })
    });


    //无条件获取导出称运单报表列表
    it("Get expoetReportCarrierOrderList list normal",(done) => {
         service.expoetReportCarrierOrderList("",true,"","","","","","","","").then((res)=>{
            expect(res.data.extData).toBe("|true||||||||");
            done();
        },(err) => {
            done.fail(err);
        })
    });

    //获取合同号包含"1"的导出承运单报表列表
    it("Get expoetReportCarrierOrderList list contractNum \'1\'",(done) => {
         service.expoetReportCarrierOrderList("",true,"1","","","","","","","").then((res)=>{
            expect(res.data.extData).toBe("|true|1|||||||");
            done();
        },(err) => {
            done.fail(err);
        })
    });

     //获取客户单位包含"江苏"的导出承运单报表列表
    it("Get expoetReportCarrierOrderList list clientName \'江苏\'",(done) => {
         service.expoetReportCarrierOrderList("",true,"","江苏","","","","","","").then((res)=>{
            expect(res.data.extData).toBe("|true||江苏||||||");
            done();
        },(err) => {
            done.fail(err);
        })
    });

   //获取承运商名称包含"江苏"的导出承运单报表列表
    it("Get expoetReportCarrierOrderList list carrierName \'江苏\'",(done) => {
         service.expoetReportCarrierOrderList("",true,"","","","","","","江苏","").then((res)=>{
            expect(res.data.extData).toBe("|true|||||||江苏|");
            done();
        },(err) => {
            done.fail(err);
        });
    });
    //获取驾驶员名称包含"江苏"的导出承运单报表列表
    it("Get expoetReportCarrierOrderList list driver \'1\'",(done) => {
         service.expoetReportCarrierOrderList("",true,"","","","","","","1","").then((res)=>{
            expect(res.data.extData).toBe("|true|||||||1|");
            done();
        },(err) => {
            done.fail(err);
        });
    });
    //全条件获取导出称运单报表列表
    it("Get expoetReportCarrierOrderList list allArgument",(done) => {
         service.expoetReportCarrierOrderList("1",true,"3","4","5","6","7","8","9","10").then((res)=>{
            expect(res.data.extData).toBe("1|true|3|4|5|6|7|8|9|10");
            done();
        },(err) => {
            done.fail(err);
        })
    });

});
